package com.sync.data.ievent.entity;

import com.sync.data.base.BaseEntity;
import com.sync.data.common.annotation.FieldProps;
import com.sync.data.common.annotation.FieldType;
import com.sync.data.common.obj.annoation.ObjectPrefix;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

import javax.persistence.*;

/**
 * 客户对象
 *
 * @author liquanchang
 */
@Getter
@Setter
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "accCategory", discriminatorType = DiscriminatorType.STRING)
@ObjectPrefix("bdcf")
public class BaseAccount extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 客户名称(中文)
     */
    @FieldProps(type = FieldType.STRING, label = "客户名称")
    private String accName;
    /**
     * 客户类别
     */
    @FieldProps(type = FieldType.STRING, label = "客户类别")
    private String accType;
    /**
     * 客户类别
     */
    @FieldProps(type = FieldType.STRING, label = "客户类别")
    @Column(insertable = false,updatable = false)
    private String accCategory;
    /**
     * 客户名称(英文)
     */
    @FieldProps(type = FieldType.STRING, label = "客户名称(英文)")
    private String accNameEn;
    /**
     * 职称
     */
    @FieldProps(type = FieldType.STRING, label = "职称")
    private String accTitle;
    /**
     * 标准科室
     */
    @FieldProps(type = FieldType.STRING, label = "标准科室")
    private String accDepart;

    /**
     * 医院名称
     */
    @FieldProps(type = FieldType.STRING, label = "医院名称")
    private String hospitalName;

    /**
     * 国家
     */
    @FieldProps(type = FieldType.STRING, label = "国家/地区")
    private String accCountry;
    /**
     * 客户地址
     */
    @FieldProps(type = FieldType.STRING, label = "客户地址")
    private String accAddress;
    /**
     * 邮编
     */
    @FieldProps(type = FieldType.STRING, label = "邮编")
    private String postalCode;

//    @FieldProps(type = FieldType.STRING)
//    private String accCode;
    /**
     * 省
     */
    @FieldProps(type = FieldType.CASCADE, label = "省", cascadeObject = "SysRegion", cascadeLevel = 1)
    private String accProvince;
    /**
     * 市
     */
    @FieldProps(type = FieldType.CASCADE, label = "市", cascadeObject = "SysRegion", cascadeLevel = 2)
    private String accCity;
    /**
     * 区
     */
    @FieldProps(type = FieldType.CASCADE, label = "区", cascadeObject = "SysRegion", cascadeLevel = 3)
    private String accRegion;
    /**
     * 原始数据来源
     */
    @FieldProps(type = FieldType.STRING, label = "原始数据来源")
    private String dataFrom;
    /**
     * 原始数据ID
     */
    @FieldProps(type = FieldType.STRING, label = "原始数据ID")
    private String legacyId;
    /**
     * 原始数据父级ID
     */
    @FieldProps(type = FieldType.STRING, label = "原始数据父级ID")
    private String legacyPid;

    @FieldProps(type = FieldType.STRING, label = "联系电话")
    private String accPhone;

    /**
     * 是否是目标
     */
    @FieldProps(type = FieldType.NUMBER, label = "是否是目标")
    private Integer isTarget;

    /**
     * 外部编号
     */
    @FieldProps(type = FieldType.STRING, label = "外部编号")
    private String externalId;

    /**
     * 是否生效 0-无效, 1-有效
     */
    @FieldProps(type = FieldType.SHARE_DICT, label = "是否生效", shareDict = "isActive")
    private Integer isActive;

    private String customField1;
    private String customField2;
    private String customField3;
    private String customField4;
    private String customField5;
    private String customField6;
    private String customField7;
    private String customField8;
    private String customField9;
    private String customField10;
}
